package com.fili.gui.components;

import com.fili.core.storage.StorageItem;

import javax.swing.table.AbstractTableModel;
import java.util.ArrayList;

/**
 * Created by Claudiu-Florin FILIMON
 * Date: Oct 18, 2006
 * Time: 8:59:32 PM
 */
public class DryTableModel extends AbstractTableModel
{
    private ArrayList<StorageItem> items;

    public DryTableModel()
    {
        items = new ArrayList<StorageItem>();
    }
    public DryTableModel(StorageItem[] items)
    {
        this.items = new ArrayList<StorageItem>(items.length);
        for (StorageItem item : items)
            this.items.add(item);
    }

    public void addItem(StorageItem item)
    {
        items.add(item);
        fireTableRowsInserted(items.size()-2,items.size()-1);
    }

    public int getRowCount()
    {
        return 10;
    }

    public int getColumnCount()
    {
        return 10;
    }

    public Object getValueAt(int rowIndex, int columnIndex)
    {
        return rowIndex+"x"+columnIndex;
    }
}
